@import (once) "../../include/vars";
@import (once) "../../include/mixins";

:root {
    --taginput-border-radius: 4px;
    --taginput-color: var(--input-color);
}

.dark-side {
    --taginput-color: var(--input-color);
}

.tag-input {
    display: flex;
    flex-flow: row wrap;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    padding: 0 2px;
    cursor: text;
    position: relative;
    height: auto;
    min-height: var(--input-height, 36px);
    border-radius: var(--taginput-border-radius);
    //overflow: hidden;
    
    .original-input {
        width: 1px;
        height: 1px;
        position: absolute;
        top: 0;
        left: 0;
        opacity: 0;
    }

    .input-wrapper {
        width: auto;
        border: none!important;
        height: calc( var(--input-height) - 6px );
        font-size: 14px;
        padding: 0 4px;
        background: transparent;
        color: var(--taginput-color);        
        
        &:focus {
            box-shadow: none!important;
        }
    }

    .input-clear-button {
        //font-family: "Segoe UI Symbol", serif;
        position: absolute;
        top: 2px;
        right: 2px;
        z-index: 2;
        background-color: transparent;
        height: calc( var(--input-height) - 6px );
        width: calc( var(--input-height) - 6px );
    }

    &.padding-for-clear {
        padding-right: 48px;
    }
}

.tag-input {
    &.static-mode {
        border: none!important;
        cursor: default;

        .button, input {
            display: none!important;
        }
    }
}

.tag-input {
    .autocomplete-list {
        margin: 0;
        padding: 0;
        list-style: none inside;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        overflow: hidden;
        overflow-y: auto;
        background-color: @white;
        height: auto;
        border: 1px solid var(--border-color);
        z-index: 3;
        display: block;

        .item {
            display: block;
            position: relative;
            padding: 4px 8px;
            cursor: pointer;

            &:hover {
                background-color: @hoverBackground;
            }
        }

        .item + .item {
            border-top: 1px solid var(--border-color);
        }
    }
}